#pragma once
#include <osg/Vec3d>

#include "CmdHandler3.h"

class TopoDS_Edge;
class Ent;
class Ent2DCurve;
class UCS;
class SelectHandler3D;
struct CombineCurveData
{
	std::shared_ptr<Ent2DCurve> ent;
	bool reverse = false;
	double lenth;
	osg::Vec3d startPt;
	osg::Vec3d endPt;
};
class CombineCurveHandler : public CmdHandler3
{
	Q_OBJECT
public:
	Q_INVOKABLE CombineCurveHandler();
	~CombineCurveHandler();

	virtual void input(const QVariant& data, const QString& rawInput, CommandSource cs) override;
	bool projCompositeLine(const CombineCurveData& horizontalData, const CombineCurveData& verticalData, const double hStartLen, const double vStartLen);
	bool sortDatas(std::vector<CombineCurveData>& Datas,const osg::Vec3d& startPt);
	std::vector<CombineCurveData> m_horizontalDatas;
	std::vector<CombineCurveData> m_verticalDatas;
	std::set<std::shared_ptr<INode>> m_ents;
	UCS* m_ucs = nullptr;
};
